import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        flag: true,
        token:sessionStorage.getItem('userToken')||"",
        userId:sessionStorage.getItem("userId"),
        examClass:sessionStorage.getItem("examClass")

    },
    getters: {},
    mutations: {
        setToken(state, data) {
            state.token = data
            sessionStorage.setItem('userToken', data)
        },
        setUserId(state, data) {
            state.userId = data
            sessionStorage.setItem('userId',data)
        },
        setexamClass(state,data){
            state.examClass = data
            sessionStorage.setItem('examClass',data)
        }
    },
    actions: {},
    modules: {}
})